<!DOCTYPE html>
<html>
<head>
    <title>Chainlit iframe</title>
</head>
<body>
    <h1>Chainlit iframe</h1>
    <iframe src="http://127.0.0.1:8000/" id="the-frame" data-cy="the-frame" width="100%" height="500px"></iframe>
    <div id="message">No message received</div>
    <script>
        window.addEventListener('message', function(event) {
            if (event.data.startsWith("Server: ")) {
                document.getElementById('message').innerText = event.data;
            }
        });
    </script>
</body>
</html>
